import { OverlayContainer } from '@angular/cdk/overlay';
import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss'],
})
export class AppComponent {
  darkTheme = false;
  squareState = 'green';

  constructor(private oc: OverlayContainer) {}

  switchTheme(dark: boolean): void {
    this.darkTheme = dark;

    this.oc
      .getContainerElement()
      .classList.add(dark ? 'myapp-dark-theme' : null);
  }
}
